home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / revolveSetOptionVars.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.8 KB  |  146 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Mar. 14, 1997
  22. //  Author:         laf
  23. //
  24. //  Description:
  25. //      Global function to make sure the options for revolve are set.
  26. //
  27. //  Input Arguments:
  28. //      Force the factory setting or not.
  29. //
  30. //  Return Value:
  31. //      None.
  32. //
  33.  
  34. global proc revolveSetOptionVars( int $forceFactorySettings )
  35. {
  36.     string $isitYup = `upAxis -q -ax`;
  37.  
  38.     // revolveUseAxis (int) - can be 0|1|2|3 for use X, use Y, use Z,
  39.     // or use Free axis.
  40.     //
  41.     if ($forceFactorySettings || !`optionVar -exists revolveUsePresetAxis`) {
  42.         if( "y" == $isitYup ) {
  43.             optionVar -intValue revolveUsePresetAxis 1;
  44.         }
  45.         else {
  46.             optionVar -intValue revolveUsePresetAxis 2;
  47.         }
  48.     }
  49.  
  50.     // revolveAxisX, revolveAxisY, revolveAxisZ (float) - to define
  51.     // the axis of revolution.
  52.     //
  53.     if ($forceFactorySettings || !`optionVar -exists revolveAxisX`) {
  54.         optionVar -floatValue revolveAxisX 0.0;
  55.     }
  56.     if ($forceFactorySettings || !`optionVar -exists revolveAxisY`) {
  57.         if( "y" == $isitYup ) {
  58.             optionVar -floatValue revolveAxisY 1.0;
  59.         }
  60.         else {
  61.             optionVar -floatValue revolveAxisY 0.0;
  62.         }
  63.     }
  64.     if ($forceFactorySettings || !`optionVar -exists revolveAxisZ`) {
  65.         if( "y" == $isitYup ) {
  66.             optionVar -floatValue revolveAxisZ 0.0;
  67.         }
  68.         else {
  69.             optionVar -floatValue revolveAxisZ 1.0;
  70.         }
  71.     }
  72.  
  73.     // revolveUseLocalPivot (int) - can be 1|0 for use Local or use Global
  74.     // pivot point.
  75.     //
  76.     if ($forceFactorySettings || !`optionVar -exists revolveUseLocalPivot`) {
  77.         optionVar -intValue revolveUseLocalPivot 1;
  78.     }
  79.  
  80.     // revolvePivotX, revolvePivotY, revolvePivotZ (float) - to define
  81.     // the pivot of revolution.  Only used when revolveUseLocalPivot is 0.
  82.     //
  83.     if ($forceFactorySettings || !`optionVar -exists revolvePivotX`) {
  84.         optionVar -floatValue revolvePivotX 0.0;
  85.     }
  86.     if ($forceFactorySettings || !`optionVar -exists revolvePivotY`) {
  87.         optionVar -floatValue revolvePivotY 0.0;
  88.     }
  89.     if ($forceFactorySettings || !`optionVar -exists revolvePivotZ`) {
  90.         optionVar -floatValue revolvePivotZ 0.0;
  91.     }
  92.  
  93.     // revolveUseLocalPivot (int) - can be 1|0 for use Local or use Global
  94.     // pivot point.
  95.     // revolveStartSweepAngle, revolveEndSweepAngle (float) - to define
  96.     // the sweep angle of the revolution.
  97.     //
  98.     if ($forceFactorySettings || !`optionVar -exists revolveStartSweepAngle`) {
  99.         optionVar -floatValue revolveStartSweepAngle 0.0;
  100.     }
  101.     if ($forceFactorySettings || !`optionVar -exists revolveEndSweepAngle`) {
  102.         optionVar -floatValue revolveEndSweepAngle 360.0;
  103.     }
  104.  
  105.     // revolveSurfaceDegree (int) - either 1|3 for linear or cubic
  106.     // surface degree on the resulting revolved surface
  107.     //
  108.     if ($forceFactorySettings || !`optionVar -exists revolveSurfaceDegree`) {
  109.         optionVar -intValue revolveSurfaceDegree 3;
  110.     }
  111.  
  112.     // revolveUseTolerance (int) - either 1|0 for use tolerance or not.
  113.     // revolveTolerance (float) - the tolerance to use
  114.     //
  115.     if ($forceFactorySettings || !`optionVar -exists revolveUseGlobalTol`) {
  116.         optionVar -intValue revolveUseGlobalTol 0;
  117.     }
  118.     if ($forceFactorySettings || !`optionVar -exists revolveUseTolerance`) {
  119.         optionVar -intValue revolveUseTolerance 0;
  120.     }
  121.     if ($forceFactorySettings || !`optionVar -exists revolveTolerance`) {
  122.         optionVar -floatValue revolveTolerance 0.01;
  123.     }
  124.  
  125.     // revolveNumberOfSegments (int) - number of segments/spans for the
  126.     // resulting revolved surface
  127.     //
  128.     if ($forceFactorySettings || !`optionVar -exists revolveNumberOfSegments`){
  129.         optionVar -intValue revolveNumberOfSegments 8;
  130.     }
  131.  
  132.     // revolveCurveRangePartial (int) - either 0|1 for using the complete
  133.     // curve or only a partial curve for the revolution
  134.     //
  135.     if ($forceFactorySettings || 
  136.         !`optionVar -exists revolveCurveRangePartial`){
  137.         optionVar -intValue revolveCurveRangePartial 0;
  138.     }
  139.  
  140.     // revolveOutputPolygons (int) - either 0|1 for polygon or Nurbs output
  141.     //
  142.     if ($forceFactorySettings || !`optionVar -exists revolveOutputPolygons`){
  143.         optionVar -intValue revolveOutputPolygons 0;
  144.     }
  145. }
  146.